<html>
    <head>
        <title>图片上传</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type='text/javascript' src='/public/js/jquery-1.11.2.min.js'></script>
    </head>
    <body style="width:100%;height: 100%">
        <div>
            <form action="/home/store/upload" method="post" enctype="multipart/form-data" id='up'>
            <input type="file" name="code" style='width:9rem;' id='codes'>
            <input type="button" value="上传" onclick='sbm()'>
            <input type="hidden" value="{$path}" id="_img_">
            </form>
        </div>
        <script type="text/javascript">
            document.domain = '<?php echo _DOMAIN_ALL_?>';
             $(document).ready(function(){
                 var path = $('#_img_').val();
                 if(path.length>0){
                     $("#code",window.parent.document).css("padding-top","0");
                     $("#code",window.parent.document).css("padding-left","0");
                     $("#code",window.parent.document).attr('src',path);
                     $("#code_img",window.parent.document).val(path);
                 }
             })
             function sbm(){
                var codes = $("#codes").val();
                if(codes ==''){
                   alert("请上传二维码  如已上传请稍等");
                }else{
                     $("#up").submit();
                }
             }
        </script>
    </body>
</html>